To run an ActionScript, you'll need to create a custom toolbutton in order to execute it from within the program. To do this, select "Customize" from the "Options" menu and switch to the "Toolbar" page. It's a good idea to create a separate toolbar just for your custom scripts, so click the "Add Toolbar" button to create a new toolbar, giving it a name such as "Custom Scripts." Next, click "Add Custom Button," and select the "Execute an ActiveScript file" option. Then just select the external script file, and give the toolbutton a unique caption or image.
Now that you've created both the custom toolbar and toolbutton, make sure that the toolbar will be displayed by placing a checkmark next to it in the list of available toolbars on the Customization dialog. That's it - you now have a toolbutton that will execute a script file.
If the scripting engine encounters an error while executing your custom script, the script file will be opened in the editor and the offending line will be selected. In addition, information about the error will be displayed in the status bar, helping you to debug the problem.